<?php
/**
 * Created by 1971599474@qq.com
 * User: zhixuan
 * Date: 2019/12/10
 * Time: 11:09
 */

namespace app\admin\validate;


use think\Validate;

class PrivilegeValidate extends Validate
{
    protected $rule =   [
        'pri_name'  => 'require',
        'module_name'   => 'require',
        'controller_name' => 'require',
        'action_name' => 'require',
        'is_menu'=>'number',
    ];

    protected $message  =   [
        'pri_name.require' => '权限名称不能为空',
        'module_name.require'   => '模块名称不能为空',
        'controller_name.require'   => '控制器名称不能为空',
        'action_name.require'   => '方法名称不能为空',
        'is_menu.number'=>'是否菜单必须是一个数字',
    ];

    protected $scene = [
        'add'  =>  ['pri_name', 'module_name', 'controller_name','action_name'],
        'edit'  =>  ['pri_name', 'module_name', 'controller_name','action_name'],
    ];
}